package com.sghd.fight.module.game.event;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;

public class PushEvent {
    public static final String NAME = "ROOM:PUSH_EVENT";
    /**消息体*/
    private Object body;
    /**接收玩家*/
    private Collection<Long> playerIds;
    /**对应的命令*/
    private int command;

    public static PushEvent valueOf(Object body, Collection<Long> playerIds, int command) {
        PushEvent result = new PushEvent();
        result.body = body;
        result.playerIds = new ArrayList<>(playerIds);
        result.command = command;
        return result;
    }

    public static PushEvent valueOf(Object body, long playerId, int command) {
        PushEvent result = new PushEvent();
        result.body = body;
        result.playerIds = Arrays.asList(playerId);
        result.command = command;
        return result;
    }

    public Object getBody() {
        return body;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    public Collection<Long> getPlayerIds() {
        return playerIds;
    }

    public void setPlayerIds(Collection<Long> playerIds) {
        this.playerIds = playerIds;
    }

    public int getCommand() {
        return command;
    }

    public void setCommand(int command) {
        this.command = command;
    }
}
